package com.xuzimian.demo.java.proxy.dynamic.performance.handler

import java.lang.reflect.InvocationHandler
import java.lang.reflect.Method

class JdkHandler(private val target: Any) : InvocationHandler {
    @Throws(Throwable::class)
    override fun invoke(proxy: Any, method: Method, args: Array<Any>?): Any {
        return method.invoke(target, *(args ?: arrayOfNulls<Any>(0)))
    }

}